<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script language="javascript">

            function SetScreenNum(varStr)
            {
                console.log("SetScreenNum");
                TestOCX.SetScreenNum(varStr); 
            }
            function Play(index, ip, port, username, password)
            {
                console.log("play video");
                if(null == ip || "" == ip){
                    return TestOCX.Play(0, "33.101.61.40", 37777, "admin", "admin123", 0, 0);
                } else {
                    console.log("播放："+ip+", 端口："+ port + ", 用户名：" + username + ", 密码：" + password);
                    return TestOCX.Play(index, ip, port, username, password, 0, 0); 
                }
            }
            function StopPlay(varStr)
            {
                return TestOCX.StopPlay(varStr);
            }
            function StopAllPlay()
            {
                return TestOCX.StopAllPlay();
            }
            function GetSelPlayIndex()
            {
                TestOCX.GetSelPlayIndex(); 
            }
            function CapPic(index, path) {
                TestOCX.CapPic(index, path);
            }
            function changeObjectSize(){
                console.log(document.body.clientWidth);
                console.log(document.body.clientHeight);
                var width = document.body.clientWidth;
                var height = document.body.clientHeight;
                if(!width){
                    width = 1020;
                }
                if(!height){
                    height = 700;
                }
                console.log(document.getElementById("TestOCX").width);
                document.getElementById("TestOCX").width = width;
                document.getElementById("TestOCX").height = height;
                SetScreenNum(4);
            }
        </script>

    </head>
    <body onload="changeObjectSize()">
        <OBJECT ID="TestOCX" WIDTH="1020" HEIGHT="700" CLASSID="CLSID:6F8B309C-14AD-4F53-8E17-AF1594F4933C">
        </OBJECT> 
    </body>  
</html>

